package baiqitun.stupro.project.core.document.entity;

import baiqitun.stupro.common.constant.SysConstant;
import baiqitun.stupro.common.entity.Entity;
import baiqitun.stupro.common.validate.group.SaveGroup;
import baiqitun.stupro.common.validate.group.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Null;

/**
 * 项目简介
 * 使用MongoDB存储，无法利用MyBatisPlus自动填充字段值
 * 所以使用了构造方法来模拟此功能
 * @author kedaji
 */
@ApiModel("项目文档")
@Accessors(chain = true)
@Data
public class SysProjectDocument extends Entity {
    @Null(message = SysConstant.ER_PARAMETER_MUST_NULL, groups = {UpdateGroup.class})
    @NotBlank(message = "文档类型不能为空", groups = {SaveGroup.class})
    @ApiModelProperty("文档类型：0.Markdown文档  1.富文本文档")
    private String type;
    @ApiModelProperty("文档内容：")
    private String content;
}
